import Http, {HttpParamsProps, ReqProps} from "@/common/http";
import {BaseEntity} from "@/common/httptypes";


export type EntityConfigModel = {
    id: number
    label: string
    labelName: string
    type: number
    content: string
} & BaseEntity


class EntityFeeList {
    RowKey = "id"
    EDIT = "configEdit"
    ADD = "configAdd"
    DEL = "configDel"
    MAPPING = {configEdit: "编辑配置", configAdd: "新增配置"}


    selectTablePage(props: HttpParamsProps): Promise<Response> {
        return Http.get("/api/config/page", props)
    }

    selectById(props: ReqProps<EntityConfigModel>) {
        Http.doGet("/api/config/find", props)
    }

    doEdit(props: ReqProps<void>) {
        Http.doPost("/api/config/edit", props)
    }

    delete(props: ReqProps<void>) {
        Http.doPost("/api/config/delete", props)
    }

}

// eslint-disable-next-line import/no-anonymous-default-export
export default new EntityFeeList()